package com.atguigu.gmall.payment.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.payment.PaymentInfo;
import com.atguigu.gmall.payment.client.impl.PaymentDegradeFeinClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * ClassName: PaymentFeignClient
 * Package: com.atguigu.gmall.payment.client
 * Description:
 *
 * @Author 刘轩
 * @Create 2023-09-09 11:24
 * @Version 1.0
 */

@FeignClient(value = "service-payment",fallback = PaymentDegradeFeinClient.class)
public interface PaymentFeignClient {

 /**
  * 查询本地交易记录
  * @param outTradeNo
  * @return
  */
 @GetMapping("/api/payment/alipay/getPaymentInfo/{outTradeNo}")
 public PaymentInfo getPaymentInfo(@PathVariable String outTradeNo);



 /**
  * 根据订单ID关闭支付宝交易记录
  * @param orderId 订单ID
  * @return
  */
 @GetMapping("/api/payment/alipay/closeAlipay/{orderId}")
 public Result closeAlipay(@PathVariable Long orderId);



 /**
  * 查看是否有交易记录
  * @param orderId
  * @return
  */
 @GetMapping("/api/payment/alipay/checkPayment/{orderId}")
 public Result checkPayment(@PathVariable Long orderId);

}

